IconTheme: Simplify icon scaling
authorAlexander Larsson <alexl@redhat.com>
Wed, 5 Feb 2020 14:47:23 +0000 (15:47 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 6 Feb 2020 08:38:25 +0000 (09:38 +0100)
commitb529f778270d01156e46ba9e012bf0fd4288e680
tree8ba8e32de4dbbb6b05f8117c038b85a6908dce79
parent021aaef824283644a02938e04d4c1958cdb0a389
IconTheme: Simplify icon scaling

We had a pretty complex setup where we tried to avoid scaling up themes from dirs
that specified a size. However, not only was it very complex, but it didn't quite
work with window scales, because when using e.g. a size 32 directory for 16@2x
the dir size is wrong anyway. Additionally it turns out most code either picks
an existing icon size, or uses the FORCE_SIZE flags, so it doesn't seem
like a useful behaviour.

This change drops the FORCE_SIZE flags, and always scales
icons. Additionally it moves the scaling of the icon to rendering,
which seems more modern, and allows us to (later) share icons loaded
for different sizes that happened to use the same source file (at
different scales).

Note that this changes the behaviour of
gtk_icon_paintable_download_texture() is it now returns the unscaled
source icon. However, ignore thats, as I plan to remove this function
and replace it with a way to render a paintable to a cairo-surface
instead.
demos/icon-browser/iconbrowserwin.c
demos/icon-browser/window.ui
gtk/gtkcellrendererpixbuf.c
gtk/gtkiconhelper.c
gtk/gtkiconhelperprivate.h
gtk/gtkicontheme.c
gtk/gtkicontheme.h
gtk/gtkwindow.c
testsuite/gtk/icontheme.c